<template>
	<div>
		<!-- 购物车头部 -->
		<van-nav-bar>
			<template #title>
				<span style="font-size: 13px;">购物车</span>
			</template>
		 <template #left>
			 <span style="color: #D90000;font-size: 11px;">编辑</span>
		 </template>
		 <template #right>
			 <span @click="back" style="color: #D90000;font-size: 11px;">返回</span>
		 </template>
		 </van-nav-bar>
		
		<!-- 商品卡片 -->
		<van-checkbox-group v-model="result" @change="selGoods">
		  <van-row v-for="(item,index) in $store.state.cartList" :key="index">
		    <van-swipe-cell>
		      <van-col span="2">
		        <van-checkbox :name="item"></van-checkbox>
		      </van-col>
		      <van-col span="22">
		        <van-card
		          :price="item.goods.characteristic"
		          :title="item.goods.name"
		          :thumb="item.goods.minPrice"
		        >
		          <template #num>
		            <van-stepper v-model="item.num" @change="numChange" />
		          </template>
		        </van-card>
		      </van-col>
		      <template #right>
		        <van-button
		          square
		          text="删除"
		          type="danger"
		          style="height:100px"
		          @click="del(item,index)"
		        />
		      </template>
		    </van-swipe-cell>
		  </van-row>
		</van-checkbox-group>
		
		<!-- 再下方的猜你喜欢 -->
		<div class="titles">猜你喜欢</div>
		<div class="list">
		  <my-list class="listitem" v-for="(item,index) in lists" :key="index" :item="item" />
		</div>
		
		<van-submit-bar :price="total" button-text="提交订单">
		  <van-checkbox
		    v-model="checkAll"
		    :disabled="$store.state.cartList.length <= 0"
		    @click="selAll"
		  >全选</van-checkbox>
		</van-submit-bar>
		
		<!-- 购物车底部 -->
		<van-submit-bar :price="3050" button-text="提交订单">
		  <van-checkbox>全选</van-checkbox>
		</van-submit-bar>
	</div>
</template>

<script>
	export default {
		data(){
			return {
				
			}
		},
		methods:{
			back(){
				window.history.go(-1)
			}
		}
	}
</script>

<style scoped>
	
</style>
